|
|
|
|
|
|
|
The code in Listing 9.18 creates the database and then opens a single table to access one of the fields. The rest of the code loops through the collection to list the properties for the selected field. The results are displayed in the message box. Check your screen against the one in Figure 9.17. |
|
|
|
|
|
|
|
|
Figure 9.17.
The Field properties in
the Debug window. |
|
|
|
|
|
|
|
|
The list of field properties is quite extensive. You are encouraged to check out the Visual Basic documentation for details on some of the less obvious properties. Also remember that you may be seeing properties added by other DAO applications and that there may be no documentation for these custom properties. |
|
|
|
|
|
|
|
|
The Index object is used to contain information on defined indexes for the associated table. Indexes can only be built for native Microsoft Jet data tables (no attached tables allowed). You can use indexes for two purposes: to enforce data integrity rules and to speed access for single-record lookups. |
|
|
|
|
|
|
|
|
Indexes are always associated with an existing data table. You must create a native Microsoft Jet data table before you can create an index. Listing 9.19 shows how to create an index through Visual Basic code and view its properties. |
|
|
|
|
|
|
|
|
Add a command button to the form with a Name property of cmdIndex and a Caption property of &Index. Add the code in Listing 9.19 to the cmdIndex_Click event. |
|
|
|
|
|